// define(function(require) {

  import React from 'react';
  import View from 'jsx!../view'

  class Wrap2 extends React.Component {
    static propTypes: {
      arr: React.PropTypes.array,
      children: React.PropTypes.object
    }

    constructor() {
      super()
    }

    componentDidMount() {
      console.log('componentDidMount Wrap2')
    }

    componentWillReceiveProps(nextProps) {
      console.log('componentWillReceiveProps Wrap2')
    }

    componentWillUnmount() {
      console.log('componentWillUnmount Wrap2')
    }

    shouldComponentUpdate(nextProps, nextState) {
      // if (nextProps.v === this.props.v) {
      //   return false;
      // }
      return true;
    }

    render() {
      console.log('render Wrap2')
      return (
        <div className='fl'>
          <h2>Wrap2</h2>
          {
            2
            ? this.props.children
            : _.map(this.props.arr, (v, index) => {
                return <View key={index} v={v} id={'wrap2-' + index} />
              })
          }
        </div>
      )
    }
  }

  export default Wrap2;
// })